package goodroommate.service.impl;

import goodroommate.dao.IAppConfigDao;
import goodroommate.dao.impl.AppConfigDao;
import goodroommate.service.IConfigService;

public class ConfigService implements IConfigService {

	private IAppConfigDao appConfigDao = new AppConfigDao();

	@Override
	public String getUserContentsPath(String defaultValue) {
		String value = appConfigDao.getPropertyValue("usercontents_path");
		if (value == null)
			return defaultValue;
		value = value.trim();
		if ("".equals(value))
			return defaultValue;
		return value;
	}

	@Override
	public String getComputingPlatformRoot(String defaultValue) {
		String value = appConfigDao.getPropertyValue("computingplatform_root");
		if (value == null)
			return defaultValue;
		value = value.trim();
		if ("".equals(value))
			return defaultValue;
		return value;
	}
}
